﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;
using Ashlen.Portal.Core;
using Ashlen.Portal.Core.DTO;
using Ashlen.Portal.Core.DataInterfaces;
using Ashlen.Portal.Data;
using Ashlen.Portal.Services.BindingExtensions;

namespace Ashlen.Portal.Services
{
    [ServiceContract]
    public interface INewsService
    {
        [OperationContract]
        //[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string GetNewsSources();

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string GetNewsSection();

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string GetNewsHeadlines(int source, HeadlinesType type, NewsSortBy sortBy);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        string SearchNewsHeadlines(NewsSearchRequest request);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest)]
        [JSONPBehavior(callback = "callback")] 
        void HitUpdate(string id); 
    }

    
}
